
export class DateUtil {

  static getDate() {
    let date = new Date()
    let month = (date.getMonth() + 1)+""
    let day = date.getDate()+""
    if (month.length == 1) {
      month = "0"+month
    }
    if (day.length == 1) {
      day = "0"+day
    }
    let time = date.getFullYear() + "-" + month + "-" + day + " "
    return time
  }

  static getWeek() {
    let week = "星期一"
    let date = new Date()
    let day = date.getDay()
    if (day == 1) {
      week = "星期一"
    }else if (day == 2) {
      week = "星期二"
    }else if (day == 3) {
      week = "星期三"
    }else if (day == 4) {
      week = "星期四"
    }else if (day == 5) {
      week = "星期五"
    }else if (day == 6) {
      week = "星期六"
    }else if (day == 7) {
      week = "星期日"
    }

    return week
  }
}